package com.hqyj.zss.services.impl;

import com.hqyj.zss.dao.DetailOrderDao;
import com.hqyj.zss.pojo.*;
import com.hqyj.zss.services.DetailOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DetailOrderServiceImpl implements DetailOrderService {

    private DetailOrderDao detailOrderDao;

    @Autowired
    public void setDetailOrderDao(DetailOrderDao detailOrderDao) {
        this.detailOrderDao = detailOrderDao;
    }

    @Override
    public int insertDetailOrder(DetailOrder detailOrder) {
        int i = detailOrderDao.insertDetailOrder(detailOrder);
        return i;
    }

    @Override
    public Menus getByMenuName(String name) {
        Menus menus = null;
        if (name!=null){
            menus = detailOrderDao.getByMenuName(name);
        }
        return menus;
    }

    @Override
    public List<Seat> getSeat() {
        List<Seat> list = detailOrderDao.getSeat();
        return list;
    }

    @Override
    public List<Employee> getEmployee() {
        List<Employee> list = detailOrderDao.getEmployee();
        return list;
    }

    @Override
    public int insertOrder(Order order) {
        if (order!=null){
            int i = detailOrderDao.insertOrder(order);
            return i;
        }
        return 0;
    }

    @Override
    public int updateSeat(Seat seat) {
        return detailOrderDao.updateSeat(seat);
    }

    @Override
    public int updateOrder(Order order) {
        int i = detailOrderDao.updateOrder(order);
        return i;
    }


}
